package com.code2roc.fastboot.system.common.controller;

import com.code2roc.fastboot.model.BaseBootController;
import com.code2roc.fastboot.framework.model.Result;
import com.code2roc.fastboot.system.setting.bizlogic.ConfigLogic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/system/common/config")
public class ConfigController extends BaseBootController {
    @Autowired
    private ConfigLogic configLogic;

    @ResponseBody
    @PostMapping("/getConfig")
    public Object userLogin(@RequestBody Map<String, Object> params) {
        Result result = Result.okResult();
        HashMap config = new HashMap();
        config.put("systemName",configLogic.getConfigValueByName("SystemName"));
        config.put("staticFileVersion",configLogic.getConfigValueByName("StaticFileVersion"));
        config.put("fileChunkSize",configLogic.getConfigValueByName("FileChunkSize"));
        result.add("obj",config);
        return result;
    }
}
